PHP substr () function parameter description and usage example, substr parameter description
The examples in this paper describe the substr () function parameter description and usage in PHP. Share to everyone for your reference. Specific as
Used in today's project to remove the last character in a string
The original string 1,2,3,4,5,6,
Remove the last character "," and the end result is 1,2,3,4,5,6
The code is as follows:
Copy the Code code as follows:
$str = "1,2,3,4,5,6,";$newstr =
PHP uses substr () to intercept strings. what should I do if Chinese characters are garbled ,. In PHP, how to use substr () to intercept strings with Chinese garbled characters? in PHP program development, string truncation operations, such as
One of the most important techniques in PHP is to intercept specified characters in a specified string. PHP can use the PHP pre-defined function substr () for string truncation. One of the most important techniques in PHP is to intercept specified
The younger brother not to tidy up the use of substr function, do a few examples to solve the confusion of the new, master please drift over.
Let's take a look at the syntax of the PHP substr function:
String substr (string string, int start, int
PHP substr function string truncation usage analysis, phpsubstr. Analysis on the use of substr function string truncation in PHP. phpsubstr this article describes the use of substr function string truncation in PHP. For your reference, we will share
However, as long as the character string appears Chinese characters, it may cause PHP substr Chinese garbled characters, because of the Chinese UTF-8 encoding, each Chinese character occupies 3 bytes, while GB2312 occupies 2 bytes, English occupies 1
These four functions in PHP are often confusing, and here are some notes to take.
1, Strstr
strstr-displays the string that was found for the first time, to find, and subsequent strings. Case sensitive.
Code Listing:
[PHP]strstr function$email = '
In php, these four functions are often confusing. Take notes here.
1. strstr
Strstr-displays the string to be searched and the subsequent string found for the first time. Case sensitive.
Code List:
[Php]// Strstr Function$ Email = 'ruxing1715 @ sina.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.